    <%@ page language="java" contentType="text/html; charset=UTF-8"
             pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>登录 - 注册 | 超市 收银 系统</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- jquery-3.4.0.min.js
        ===========================   -->
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.4.0.min.js"></script>
        <!-- favicon
            ============================================ -->
        <link rel="shortcut icon" type="image/x-icon" href="${pageContext.request.contextPath}/css/img/favicon.ico">
        <!-- Google Fonts
            ============================================ -->
        <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,700,900" rel="stylesheet">
        <!-- Bootstrap CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
        <!-- font awesome CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css">
        <!-- owl.carousel CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/owl.carousel.css">
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/owl.theme.css">
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/owl.transitions.css">
        <!-- animate CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/animate.css">
        <!-- normalize CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/normalize.css">
        <!-- mCustomScrollbar CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/scrollbar/jquery.mCustomScrollbar.min.css">
        <!-- wave CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/wave/waves.min.css">
        <!-- Notika icon CSS
            ============================================ -->
        <link rel="stylesheet" href="css/notika-custom-icon.css">
        <!-- main CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
        <!-- style CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
        <!-- responsive CSS
            ============================================ -->
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/responsive.css">
        <!-- modernizr JS
            ============================================ -->
        <script src="${pageContext.request.contextPath}/js/vendor/modernizr-2.8.3.min.js"></script>
    </head>

    <body>
    <!--[if lt IE 8]>
    <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->
    <!-- Login Register area Start-->
    <div class="login-content">
        <!-- Login -->
        <div class="nk-block toggled" id="l-login">
            <h2 style="color: #1e80ff; padding-bottom: 100px; ">超市收银管理系统</h2>
            <div class="nk-form">
                <div class="input-group">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-support"></i></span>
                    <div class="nk-int-st">
                        <input type="text" id="username" class="form-control" placeholder="用 户 名">
                    </div>
                </div>
                <div class="input-group mg-t-15">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-edit"></i></span>
                    <div class="nk-int-st">
                        <input type="password" id="password" class="form-control" placeholder="密 码">
                    </div>
                </div>
                <div class="fm-checkbox">
                    <label><input type="checkbox" class="i-checks"> <i></i> 记 住 密 码</label>
                </div>
                <a onclick="login()" class="btn btn-login btn-success btn-float"><span>'</span><i class="notika-icon notika-right-arrow right-arrow-ant"></i></a>
            </div>

            <div class="nk-navigation nk-lg-ic">
                <a href="#" data-ma-action="nk-login-switch"  data-ma-block="#l-register"><i class="notika-icon notika-plus-symbol"></i> <span>注 册</span></a>
                <a href="#" data-ma-action="nk-login-switch" data-ma-block="#l-forget-password"><i>?</i> <span>忘 记 密 码</span></a>
            </div>
        </div>

        <!-- Register -->
        <div class="nk-block" id="l-register">
            <div class="nk-form">
                <div class="input-group">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-support"></i></span>
                    <div class="nk-int-st">
                        <input id="registerName" type="text" class="form-control" placeholder="用 户 名">
                    </div>
                </div>

                <div class="input-group mg-t-15">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-edit"></i></span>
                    <div class="nk-int-st">
                        <input id="registerPassword" type="password" class="form-control" placeholder="密 码">
                    </div>
                </div>
                <div class="input-group mg-t-15">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-edit"></i></span>
                    <div class="nk-int-st">
                        <input id="registerPassword1" type="password" class="form-control" placeholder="确 认 密 码">
                    </div>
                </div>

                <div class="input-group mg-t-15">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-dollar"></i></span>
                    <div class="nk-int-st">
                        <input id="registerGender" type="text" class="form-control" data-mask="9" placeholder="性 别（男：2 or 女：1）">
                    </div>
                </div>

                <div class="input-group mg-t-15">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-calendar"></i></span>
                    <div class="nk-int-st">
                        <input id="registerBirthday" type="text" class="form-control" data-mask="9999-99-99" placeholder="出 生 日 期（年-月-日）">
                    </div>
                </div>
                <div class="input-group mg-t-15">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-phone"></i></span>
                    <div class="nk-int-st">
                        <input id="registerPhone" type="text" class="form-control" data-mask="999 9999 9999" placeholder="电 话 号 码">
                    </div>
                </div>

                <div class="input-group mg-t-15">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-map"></i></span>
                    <div class="nk-int-st">
                        <input id="registerAddress" type="text" class="form-control" placeholder="详细住址">
                    </div>
                </div>

                <a  onclick="register()"  class="btn btn-login btn-success btn-float"><span>'</span><i class="notika-icon notika-right-arrow"></i></a>
            </div>

            <div class="nk-navigation rg-ic-stl">
                <a href="#" data-ma-action="nk-login-switch" data-ma-block="#l-login"><i class="notika-icon notika-right-arrow"></i> <span>去 登 陆</span></a>
                <a href="" data-ma-action="nk-login-switch" data-ma-block="#l-forget-password"><i>?</i> <span>忘 记 密 码</span></a>
            </div>
        </div>

        <!-- Forgot Password -->
        <div class="nk-block" id="l-forget-password">
            <div class="nk-form">
                <p class="text-left">如果您仅仅是忘记了密码，请联系管理员，或者拨打客服热线：17726643778，我们回尽快帮您恢复账号的使用，但您必须向我们提供一些必要信息用以证明您的身份。</p>

                <div class="input-group">
                    <span class="input-group-addon nk-ic-st-pro"><i class="notika-icon notika-mail"></i></span>
                    <div class="nk-int-st">
                        <input type="text" class="form-control" placeholder="管理员邮箱：524250827@qq.com">
                    </div>
                </div>

                <a href="#l-login" data-ma-action="nk-login-switch" data-ma-block="#l-login" class="btn btn-login btn-success btn-float"><span>'</span><i class="notika-icon notika-right-arrow"></i></a>
            </div>

            <div class="nk-navigation nk-lg-ic rg-ic-stl">
                <a href="" data-ma-action="nk-login-switch" data-ma-block="#l-login"><i class="notika-icon notika-right-arrow"></i> <span>去登陆</span></a>
                <a href="" data-ma-action="nk-login-switch" data-ma-block="#l-register"><i class="notika-icon notika-plus-symbol"></i> <span>去注册</span></a>
            </div>
        </div>

    </div>
    <!-- Login Register area End-->
    <!-- jquery
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/vendor/jquery-1.12.4.min.js"></script>
    <!-- bootstrap JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <!-- wow JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/wow.min.js"></script>
    <!-- price-slider JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/jquery-price-slider.js"></script>
    <!-- owl.carousel JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/owl.carousel.min.js"></script>
    <!-- scrollUp JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/jquery.scrollUp.min.js"></script>
    <!-- meanmenu JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/meanmenu/jquery.meanmenu.js"></script>
    <!-- counterup JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/counterup/jquery.counterup.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/counterup/waypoints.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/counterup/counterup-active.js"></script>
    <!-- mCustomScrollbar JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
    <!-- sparkline JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/sparkline/jquery.sparkline.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/sparkline/sparkline-active.js"></script>
    <!-- flot JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/flot/jquery.flot.js"></script>
    <script src="${pageContext.request.contextPath}/js/flot/jquery.flot.resize.js"></script>
    <script src="${pageContext.request.contextPath}/js/flot/flot-active.js"></script>
    <!-- knob JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/knob/jquery.knob.js"></script>
    <script src="${pageContext.request.contextPath}/js/knob/jquery.appear.js"></script>
    <script src="${pageContext.request.contextPath}/js/knob/knob-active.js"></script>
    <!--  Chat JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/chat/jquery.chat.js"></script>
    <!-- flot JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/flot/jquery.flot.js"></script>
    <script src="${pageContext.request.contextPath}/js/flot/jquery.flot.resize.js"></script>
    <script src="${pageContext.request.contextPath}/js/flot/flot-active.js"></script>
    <!-- knob JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/knob/jquery.knob.js"></script>
    <script src="${pageContext.request.contextPath}/js/knob/jquery.appear.js"></script>
    <script src="${pageContext.request.contextPath}/js/knob/knob-active.js"></script>
    <!-- Input Mask JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/jasny-bootstrap.min.js"></script>
    <!-- icheck JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/icheck/icheck.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/icheck/icheck-active.js"></script>
    <!-- rangle-slider JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/rangle-slider/jquery-ui-1.10.4.custom.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/rangle-slider/jquery-ui-touch-punch.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/rangle-slider/rangle-active.js"></script>
    <!-- datapicker JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/datapicker/bootstrap-datepicker.js"></script>
    <script src="${pageContext.request.contextPath}/js/datapicker/datepicker-active.js"></script>
    <!-- bootstrap select JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/bootstrap-select/bootstrap-select.js"></script>
    <!--  color-picker JS
      ============================================ -->
    <script src="${pageContext.request.contextPath}/js/color-picker/farbtastic.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/color-picker/color-picker.js"></script>
    <!--  notification JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/notification/bootstrap-growl.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/notification/notification-active.js"></script>
    <!--  summernote JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/summernote/summernote-updated.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/summernote/summernote-active.js"></script>
    <!-- dropzone JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/dropzone/dropzone.js"></script>
    <!--  wave JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/wave/waves.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/wave/wave-active.js"></script>
    <!-- icheck JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/icheck/icheck.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/icheck/icheck-active.js"></script>
    <!--  chosen JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/chosen/chosen.jquery.js"></script>
    <!--  todo JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/todo/jquery.todo.js"></script>
    <!-- Login JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/login/login-action.js"></script>
    <!-- plugins JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/plugins.js"></script>
    <!-- main JS
        ============================================ -->
    <script src="${pageContext.request.contextPath}/js/main.js"></script>
    <script type="">
        <!--用户注册功能-->
        function register() {
            if (
            $("#registerName").val()==""||
            $("#registerPassword").val()==""||
            $("#registerPassword1").val()==""||
            $("#registerGender").val()==""||
            $("#registerPhone").val()==""||
            $("#registerBirthday").val()==""||
            $("#registerAddress").val()==""
            ){
              alert("必填项不能为空")
            }
            if ( $("#registerPassword").val()!= $("#registerPassword1").val()){
                alert("两次密码不一致，请重新输入")
            }
            var url = "${pageContext.request.contextPath}/login/register"
            var param = {
                userName:$("#registerName").val(),
                Password:$("#registerPassword").val(),
                gender:$("#registerGender").val(),
                phone:$("#registerPhone").val(),
                birthday:$("#registerBirthday").val(),
                address:$("#registerAddress").val()
            }
            $.post(url,param,function (data) {
                alert(data)
                location.reload();
            })
        }



        function login() {
            if ($("#username").val()==""||
                $("#password").val()==""){
                alert("必填项不能为空")
            }else {
            var url = "${pageContext.request.contextPath}/login/log"
            var param = {
                username:$("#username").val(),
                password:$("#password").val()
            }
            $.post(url,param,function (data) {
                if (data==1){
                    location.href="${pageContext.request.contextPath}/login/adminIndex"
                }
                if (data == 2){
                    location.href="${pageContext.request.contextPath}/checker/index"
                }
                if (data==0){
                    alert("登录失败，请检查账号及密码")
                }
            });
        }
        }
    </script>
    </body>
    </html>
